interface AbstractFactory {
    public OperationController getOperationController();
    public InterfaceController getInterfaceController();
}

interface OperationController {
    public void init();
    // 其他方法声明省略
}

interface InterfaceController {
    public void init();
    // 其他方法声明省略
}

class SymbianFactory implements AbstractFactory {
    public OperationController getOperationController() {
        return new SymbianOperationController();
    }

    public InterfaceController getInterfaceController() {
        return new SymbianInterfaceController();
    }
}

class AndroidFactory implements AbstractFactory {
    public OperationController getOperationController() {
        return new AndroidOperationController();
    }

    public InterfaceController getInterfaceController() {
        return new AndroidInterfaceController();
    }
}

class SymbianOperationController implements OperationController {
    public void init() {
        // 实现代码省略
        System.out.println("SymbianOperationController实现");
    }
    // 其他方法声明省略
}

class AndroidOperationController implements OperationController {
    public void init() {
        // 实现代码省略
        System.out.println("AndroidOperationController实现");
    }
    // 其他方法声明省略
}

class SymbianInterfaceController implements InterfaceController {
    public void init() {
        // 实现代码省略
        System.out.println("SymbianInterfaceController实现");
    }
    // 其他方法声明省略
}

class AndroidInterfaceController implements InterfaceController {
    public void init() {
        // 实现代码省略
        System.out.println("AndroidInterfaceController实现");
    }
    // 其他方法声明省略
}

class Test {
    public static void main(String args[]) {
        AbstractFactory af;
        OperationController oc;
        InterfaceController ic;
        af = new SymbianFactory();
        oc = af.getOperationController();
        ic = af.getInterfaceController();
        oc.init();
        ic.init();
    }
}
